<template>
  <div class="item2" @click="$emit('click', token)">
    <van-image height="150" fit="cover" :src="image" />
    <div class="info">
      <div class="title van-multi-ellipsis--l2">{{title}}</div>
      <span v-if="coupon" class="coupon">
        <span class="title">券</span>
        <span class="price">{{coupon}}元</span>
      </span>
      <div v-if="coupon">
        <span class="rmb">¥</span>
        <span class="price">{{price}}</span>
        <span class="sub" style="text-decoration: line-through;">¥{{originalPrice}}</span>
        <span class="sub">{{volume}}人付款</span>
      </div>
      <div v-else>
        <span class="rmb">¥</span>
        <span class="price">{{price}}</span>
        <span class="sub">{{volume}}人付款</span>
      </div>
    </div>
    <div class="rebate-button">收货后再赚{{rebate}}元</div>
  </div>
</template>

<script>
import { Image, Col, Row } from "vant";
export default {
  name: "Item2",
  components: {
    [Image.name]: Image,
    [Col.name]: Col,
    [Row.name]: Row
  },
  props: {
    image: String,
    title: String,
    price: String,
    volume: Number,
    rebate: String,
    token: String,
    coupon: String,
    originalPrice: String
  }
};
</script>

<style scoped>
.item2 {
  background-color: white;
  border-radius: 10px;
}

.item2 >>> img {
  border-radius: 10px 10px 0 0;
}

.info {
  padding: 0 5px 5px;
}
.title {
  font-size: 13px;
}
.rmb {
  color: red;
  font-size: 10px;
}
.price {
  color: red;
  font-size: 18px;
}
.sub {
  font-size: 10px;
  color: #bbb;
  margin-left: 5px;
}
.rebate-button {
  font-size: 13px;
  color: white;
  padding: 1px 5px;
  background-color: red;
  border-radius: 0 0 10px 10px;
  text-align: center;
}
/* 
.coupon {
  position: relative;
}

.coupon::after {
  content: " ";
  position: absolute;
  height: 5px;
  width: 5px;
  border-radius: 5px;
  background-color: white;
  left: 15px;
  top: 10px;
} */

.coupon .title {
  font-size: 10px;
  color: white;
  background-color: #ff3030;
  padding: 1px 2px 1px 4px;
  border-radius: 3px 0 0 3px;
}

.coupon .price {
  font-size: 10px;
  border: 1px solid #ff3030;
  padding: 0 1px;
  border-radius: 0 3px 3px 0;
}
</style>